﻿using Loyalty.Application;
using Loyalty.Core.Entities;
using Loyalty.Infrastructure.EntityFramework.Interfaces;
using Loyalty.Infrastructure.EntityFramework.Poco;
using Loyalty.UI.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Loyalty.UI.Controllers
{
    public class HomeController : Controller
    {

        #region CTOR

        private readonly ICityRepository _cityRepository;
        private readonly IUnitOfWork _uow;
        public DbServiceLayer WbDBServiceLayer = null;

        public HomeController(IUnitOfWork uow, ICityRepository cityRepository)
        {
            _uow = uow;
            _cityRepository = cityRepository;
            WbDBServiceLayer = new DbServiceLayer(uow);
        }

        #endregion


        //
        // GET: /Home/
        public ActionResult Index()
        {
            City Enritit = new City()
            {
                Title = "Tehran"
            };
            ErrorExeptionsResult<City> ret = WbDBServiceLayer.City_Add(Enritit,_cityRepository);
            return View();
        }
	}
}